package com.ss.android.article.base.feature.detail2.video.a;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;

import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.RelatedVideoTouTiao;
import com.ss.android.b.a.AdsAppItem;
import com.ss.android.b.a.BaseAdsData;
import com.ss.android.common.ad.MobAdClickCombiner;
import com.ss.android.common.util.NetworkStatusMonitor;
import com.ss.android.image.loader.ImageLoader;
import org.json.JSONException;
import org.json.JSONObject;

public final class d extends e {
    private BaseAdsData l;

    public d(Context arg2, NetworkStatusMonitor arg3, ImageLoader arg4, ImageLoader arg5, int arg6, int arg7, int arg8, int arg9) {
        super(arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
        this.l = null;
        this.i = this.h * 124 / 190;
    }

    protected final void a() {
    }

    public final void a(View arg1) {
        super.a(arg1);
    }

    public final void a(Article arg1, long arg2, int arg4) {
    }

    public final void a(RelatedVideoTouTiao arg7) {
        int v5 = 8;
        if(arg7 != null && arg7.baseAdsData != null && arg7.baseAdsData.id > 0) {
            this.l = arg7.baseAdsData;
            this.f = arg7.article;
            if(this.f.groupFlags <= 0) {
                this.f.groupFlags = 32865;
            }

            this.b();
            this.c();
            this.d();
            this.f();
            this.e();
            this.b.setPadding(0, this.b.getPaddingTop(), 0, this.b.getPaddingBottom());
            this.c.setDrawable((Drawable) null, false);
            UIUtils.setVisibility(this.e, v5);
            UIUtils.setVisibility(this.c, v5);
            UIUtils.setVisibility(this.d, v5);
        }
    }

    protected final void b(View arg11) {
        if(this.l != null) {
            try {
                JSONObject v8 = new JSONObject();
                v8.put("is_ad_event", 1);
                v8.put("log_extra", this.l.logExtra);
                MobAdClickCombiner.onAdEvent(this.g, "detail_ad_list", "click", this.l.id, 0, v8, 1);
            }
            catch(JSONException v0) {
            }

            AdsAppItem.a(this.g, this.l.openUrl, this.l.webUrl, this.f.title, 0, new AdsAppItem.b(this.g, "detail_ad", null, this.l.id, this.l.logExtra));
        }
    }
}

